package com.vcms.cms.entity;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Content entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "content", catalog = "vcms_0.1")
public class Content implements java.io.Serializable {

	// Fields

	private Integer contentId;
	private ContentExt contentExt;
	private ContentCount contentCount;
	private User user;
	private Integer sortDate;
	private Integer topLevel;
	private Boolean hasTitleImg;
	private Boolean isRecommend;
	private Integer status;
	private Integer viewsDay;
	private Integer commentsDay;
	private Integer downloadsWeek;
	private Integer upsDay;
	private Set<Tag> tags = new HashSet<Tag>(0);
	private Set<Type> types = new HashSet<Type>(0);
	private Set<ContentAttr> contentAttrs = new HashSet<ContentAttr>(0);
	private Set<ContentExt> contentExts = new HashSet<ContentExt>(0);
	private Set<Topic> topics = new HashSet<Topic>(0);
	private Set<ContentCheck> contentChecks = new HashSet<ContentCheck>(0);
	private Set<ContentAttachment> contentAttachments = new HashSet<ContentAttachment>(
			0);
	private Set<UserGroup> userGroups = new HashSet<UserGroup>(0);
	private Set<Picture> pictures = new HashSet<Picture>(0);
	private Set<ContentTxt> contentTxts = new HashSet<ContentTxt>(0);
	private Set<ContentCount> contentCounts = new HashSet<ContentCount>(0);

	// Constructors

	/** default constructor */
	public Content() {
	}

	/** full constructor */
	public Content(ContentExt contentExt, ContentCount contentCount, User user,
			Integer sortDate, Integer topLevel, Boolean hasTitleImg,
			Boolean isRecommend, Integer status, Integer viewsDay,
			Integer commentsDay, Integer downloadsWeek, Integer upsDay,
			Set<Tag> tags, Set<Type> types, Set<ContentAttr> contentAttrs,
			Set<ContentExt> contentExts, Set<Topic> topics,
			Set<ContentCheck> contentChecks,
			Set<ContentAttachment> contentAttachments,
			Set<UserGroup> userGroups, Set<Picture> pictures,
			Set<ContentTxt> contentTxts, Set<ContentCount> contentCounts) {
		this.contentExt = contentExt;
		this.contentCount = contentCount;
		this.user = user;
		this.sortDate = sortDate;
		this.topLevel = topLevel;
		this.hasTitleImg = hasTitleImg;
		this.isRecommend = isRecommend;
		this.status = status;
		this.viewsDay = viewsDay;
		this.commentsDay = commentsDay;
		this.downloadsWeek = downloadsWeek;
		this.upsDay = upsDay;
		this.tags = tags;
		this.types = types;
		this.contentAttrs = contentAttrs;
		this.contentExts = contentExts;
		this.topics = topics;
		this.contentChecks = contentChecks;
		this.contentAttachments = contentAttachments;
		this.userGroups = userGroups;
		this.pictures = pictures;
		this.contentTxts = contentTxts;
		this.contentCounts = contentCounts;
	}

	// Property accessors
	@Id
	@GeneratedValue
	@Column(name = "contentId", unique = true, nullable = false)
	public Integer getContentId() {
		return this.contentId;
	}

	public void setContentId(Integer contentId) {
		this.contentId = contentId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "contentExtId")
	public ContentExt getContentExt() {
		return this.contentExt;
	}

	public void setContentExt(ContentExt contentExt) {
		this.contentExt = contentExt;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "contentCountId")
	public ContentCount getContentCount() {
		return this.contentCount;
	}

	public void setContentCount(ContentCount contentCount) {
		this.contentCount = contentCount;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "userId")
	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	@Column(name = "sortDate")
	public Integer getSortDate() {
		return this.sortDate;
	}

	public void setSortDate(Integer sortDate) {
		this.sortDate = sortDate;
	}

	@Column(name = "topLevel")
	public Integer getTopLevel() {
		return this.topLevel;
	}

	public void setTopLevel(Integer topLevel) {
		this.topLevel = topLevel;
	}

	@Column(name = "hasTitleImg")
	public Boolean getHasTitleImg() {
		return this.hasTitleImg;
	}

	public void setHasTitleImg(Boolean hasTitleImg) {
		this.hasTitleImg = hasTitleImg;
	}

	@Column(name = "isRecommend")
	public Boolean getIsRecommend() {
		return this.isRecommend;
	}

	public void setIsRecommend(Boolean isRecommend) {
		this.isRecommend = isRecommend;
	}

	@Column(name = "status")
	public Integer getStatus() {
		return this.status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	@Column(name = "viewsDay")
	public Integer getViewsDay() {
		return this.viewsDay;
	}

	public void setViewsDay(Integer viewsDay) {
		this.viewsDay = viewsDay;
	}

	@Column(name = "commentsDay")
	public Integer getCommentsDay() {
		return this.commentsDay;
	}

	public void setCommentsDay(Integer commentsDay) {
		this.commentsDay = commentsDay;
	}

	@Column(name = "downloadsWeek")
	public Integer getDownloadsWeek() {
		return this.downloadsWeek;
	}

	public void setDownloadsWeek(Integer downloadsWeek) {
		this.downloadsWeek = downloadsWeek;
	}

	@Column(name = "upsDay")
	public Integer getUpsDay() {
		return this.upsDay;
	}

	public void setUpsDay(Integer upsDay) {
		this.upsDay = upsDay;
	}

	@ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "contents")
	public Set<Tag> getTags() {
		return this.tags;
	}

	public void setTags(Set<Tag> tags) {
		this.tags = tags;
	}

	@ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "contents")
	public Set<Type> getTypes() {
		return this.types;
	}

	public void setTypes(Set<Type> types) {
		this.types = types;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "content")
	public Set<ContentAttr> getContentAttrs() {
		return this.contentAttrs;
	}

	public void setContentAttrs(Set<ContentAttr> contentAttrs) {
		this.contentAttrs = contentAttrs;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "content")
	public Set<ContentExt> getContentExts() {
		return this.contentExts;
	}

	public void setContentExts(Set<ContentExt> contentExts) {
		this.contentExts = contentExts;
	}

	@ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "contents")
	public Set<Topic> getTopics() {
		return this.topics;
	}

	public void setTopics(Set<Topic> topics) {
		this.topics = topics;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "content")
	public Set<ContentCheck> getContentChecks() {
		return this.contentChecks;
	}

	public void setContentChecks(Set<ContentCheck> contentChecks) {
		this.contentChecks = contentChecks;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "content")
	public Set<ContentAttachment> getContentAttachments() {
		return this.contentAttachments;
	}

	public void setContentAttachments(Set<ContentAttachment> contentAttachments) {
		this.contentAttachments = contentAttachments;
	}

	@ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "contents")
	public Set<UserGroup> getUserGroups() {
		return this.userGroups;
	}

	public void setUserGroups(Set<UserGroup> userGroups) {
		this.userGroups = userGroups;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "content")
	public Set<Picture> getPictures() {
		return this.pictures;
	}

	public void setPictures(Set<Picture> pictures) {
		this.pictures = pictures;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "content")
	public Set<ContentTxt> getContentTxts() {
		return this.contentTxts;
	}

	public void setContentTxts(Set<ContentTxt> contentTxts) {
		this.contentTxts = contentTxts;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "content")
	public Set<ContentCount> getContentCounts() {
		return this.contentCounts;
	}

	public void setContentCounts(Set<ContentCount> contentCounts) {
		this.contentCounts = contentCounts;
	}

}